package com.towerdefence;

import org.andengine.entity.scene.Scene;
import org.andengine.entity.sprite.ButtonSprite;

public class Menu extends Scene
{
	MainActivity act;
	int w,h;
	
	
	ButtonSprite 	start;
	ButtonSprite	exit;
	ButtonSprite	fastplay;
	
	
	
	
	Menu()
	{
		act = MainActivity.getSharedInstance();
		w = act.CAMERA_WIDTH; h = act.CAMERA_HEIGHT;
		
		start = new ButtonSprite(0,0,act.start_T,act.getVertexBufferObjectManager());
		exit = new ButtonSprite(0,0,act.exit_T,act.getVertexBufferObjectManager());
		fastplay = new ButtonSprite(0,0,act.fastplay_T,act.getVertexBufferObjectManager());
		
		skaluj_pozycjonuj();
		
		attachChild(start);
		attachChild(exit);
		attachChild(fastplay);
	}
	
	private void skaluj_pozycjonuj()
	{
		start.setPosition(w/2-start.getWidthScaled()/2,h/2 - h/4 - start.getHeightScaled()/2);
		fastplay.setPosition(w/2-fastplay.getWidthScaled()/2,h/2  - fastplay.getHeightScaled()/2);
		exit.setPosition(w/2-exit.getWidthScaled()/2,h/2  +h/4 -  exit.getHeightScaled()/2);
		
		start.setScale(w/start.getWidth()		/ 		4);
		exit.setScale(w/start.getWidth()		/ 		4);
		fastplay.setScale(w/start.getWidth()		/ 		4);
		
	}
	
	
}
